import {Redirect} from 'react-router-dom'
import SiderLayout from '../layout/sidelayout'
import Loginc from '../view/login'
import Dashboard from '../view/dashboard'
import TableRender from '../view/table'
import Forms from '../view/form'
// import Notfound from '../view/notfound'

const routes =  [
    {
        path: '/',
        exact: true,
        component: Loginc,
        routes: [
            {
                path: '/',
                component: Loginc,
                render: () => {
                    <Redirect to={"/login"} />
                }
            },
            {
                path: '/login',
                component: Loginc
            },
        ]
    },
    {
        path:'/admin',
        component: SiderLayout,
        routes: [
            {
                path:"/admin",
                exact:true,
                render:() => (
                    <Redirect to={"/admin/dashboard"}/>
                )
            },
            {
                path:"/admin/dashboard",
                component:Dashboard,
            },
            {
                path:"/admin/form",
                component:Forms,
            },
            {
                path:"/admin/table",
                component:TableRender,
            }
        ]
    }
]
export default routes